

public class hw1 {
    public static void main(String[] args) {
        int[] array={3,2,5,6,8,4,1,9,7};
        System.out.println("偶数是:");
        for (int i:array) {
            if (i%2==0){
                System.out.print(" "+i);
            }
        }
        System.out.println("\n奇数是：");
        for (int i:array) {
            if (i%2!=0){
                System.out.print(" "+i);
            }
        }
    }
}
